package c.e.a.a.e;

public final /* synthetic */ class c {
    public final e a;

    public c(e eVar) {
        this.a = eVar;
    }

    /* JADX WARNING: Missing exception handler attribute for start block: B:63:0x0146 */
    /* JADX WARNING: Missing exception handler attribute for start block: B:57:0x013f */
    /* JADX WARNING: Missing exception handler attribute for start block: B:45:0x0121 */
    public java.lang.Object a(java.lang.Object r14) {
        /*
        r13 = this;
        r0 = r13.a;
        r14 = (c.e.a.a.e.e.a) r14;
        java.util.Objects.requireNonNull(r0);
        r1 = r14.a;
        r2 = "CctTransportBackend";
        r3 = "Making request to: %s";
        b.i.b.f.m0(r2, r3, r1);
        r1 = r14.a;
        r1 = r1.openConnection();
        r1 = (java.net.HttpURLConnection) r1;
        r3 = 30000; // 0x7530 float:4.2039E-41 double:1.4822E-319;
        r1.setConnectTimeout(r3);
        r3 = r0.f;
        r1.setReadTimeout(r3);
        r3 = 1;
        r1.setDoOutput(r3);
        r4 = 0;
        r1.setInstanceFollowRedirects(r4);
        r5 = "POST";
        r1.setRequestMethod(r5);
        r3 = new java.lang.Object[r3];
        r5 = "2.3.1";
        r3[r4] = r5;
        r4 = "datatransport/%s android/";
        r3 = java.lang.String.format(r4, r3);
        r4 = "User-Agent";
        r1.setRequestProperty(r4, r3);
        r3 = "Content-Encoding";
        r4 = "gzip";
        r1.setRequestProperty(r3, r4);
        r5 = "Content-Type";
        r6 = "application/json";
        r1.setRequestProperty(r5, r6);
        r6 = "Accept-Encoding";
        r1.setRequestProperty(r6, r4);
        r6 = r14.c;
        if (r6 == 0) goto L_0x005c;
    L_0x0057:
        r7 = "X-Goog-Api-Key";
        r1.setRequestProperty(r7, r6);
    L_0x005c:
        r6 = 0;
        r8 = 0;
        r9 = r1.getOutputStream();	 Catch:{ ConnectException -> 0x0159, ConnectException | UnknownHostException -> 0x0157, c -> 0x0149, c | IOException -> 0x0147 }
        r10 = new java.util.zip.GZIPOutputStream;	 Catch:{ all -> 0x0140 }
        r10.<init>(r9);	 Catch:{ all -> 0x0140 }
        r0 = r0.a;	 Catch:{ all -> 0x013b }
        r14 = r14.b;	 Catch:{ all -> 0x013b }
        r11 = new java.io.BufferedWriter;	 Catch:{ all -> 0x013b }
        r12 = new java.io.OutputStreamWriter;	 Catch:{ all -> 0x013b }
        r12.<init>(r10);	 Catch:{ all -> 0x013b }
        r11.<init>(r12);	 Catch:{ all -> 0x013b }
        r0 = (c.e.b.i.i.d) r0;
        r0.a(r14, r11);	 Catch:{ all -> 0x013b }
        r10.close();	 Catch:{ all -> 0x0140 }
        if (r9 == 0) goto L_0x0083;
    L_0x0080:
        r9.close();	 Catch:{ ConnectException -> 0x0159, ConnectException | UnknownHostException -> 0x0157, c -> 0x0149, c | IOException -> 0x0147 }
    L_0x0083:
        r14 = r1.getResponseCode();
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r9 = "Status Code: ";
        r0.append(r9);
        r0.append(r14);
        r0 = r0.toString();
        b.i.b.f.B0(r2, r0);
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r9 = "Content-Type: ";
        r0.append(r9);
        r5 = r1.getHeaderField(r5);
        r0.append(r5);
        r0 = r0.toString();
        b.i.b.f.B0(r2, r0);
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r5 = "Content-Encoding: ";
        r0.append(r5);
        r5 = r1.getHeaderField(r3);
        r0.append(r5);
        r0 = r0.toString();
        b.i.b.f.B0(r2, r0);
        r0 = 302; // 0x12e float:4.23E-43 double:1.49E-321;
        if (r14 == r0) goto L_0x0129;
    L_0x00cf:
        r0 = 301; // 0x12d float:4.22E-43 double:1.487E-321;
        if (r14 == r0) goto L_0x0129;
    L_0x00d3:
        r0 = 307; // 0x133 float:4.3E-43 double:1.517E-321;
        if (r14 != r0) goto L_0x00d8;
    L_0x00d7:
        goto L_0x0129;
    L_0x00d8:
        r0 = 200; // 0xc8 float:2.8E-43 double:9.9E-322;
        if (r14 == r0) goto L_0x00e3;
    L_0x00dc:
        r0 = new c.e.a.a.e.e$b;
        r0.m1175init(r14, r8, r6);
        goto L_0x0166;
    L_0x00e3:
        r0 = r1.getInputStream();
        r1 = r1.getHeaderField(r3);	 Catch:{ all -> 0x0122 }
        r1 = r4.equals(r1);	 Catch:{ all -> 0x0122 }
        if (r1 == 0) goto L_0x00f7;
    L_0x00f1:
        r1 = new java.util.zip.GZIPInputStream;	 Catch:{ all -> 0x0122 }
        r1.<init>(r0);	 Catch:{ all -> 0x0122 }
        goto L_0x00f8;
    L_0x00f7:
        r1 = r0;
    L_0x00f8:
        r2 = new java.io.BufferedReader;	 Catch:{ all -> 0x011b }
        r3 = new java.io.InputStreamReader;	 Catch:{ all -> 0x011b }
        r3.<init>(r1);	 Catch:{ all -> 0x011b }
        r2.<init>(r3);	 Catch:{ all -> 0x011b }
        r2 = c.e.a.a.e.b.n.b(r2);	 Catch:{ all -> 0x011b }
        r2 = (c.e.a.a.e.b.h) r2;	 Catch:{ all -> 0x011b }
        r2 = r2.a;	 Catch:{ all -> 0x011b }
        r4 = new c.e.a.a.e.e$b;	 Catch:{ all -> 0x011b }
        r4.m1175init(r14, r8, r2);	 Catch:{ all -> 0x011b }
        if (r1 == 0) goto L_0x0114;
    L_0x0111:
        r1.close();	 Catch:{ all -> 0x0122 }
    L_0x0114:
        if (r0 == 0) goto L_0x0119;
    L_0x0116:
        r0.close();
    L_0x0119:
        r0 = r4;
        goto L_0x0166;
    L_0x011b:
        r14 = move-exception;
        if (r1 == 0) goto L_0x0121;
    L_0x011e:
        r1.close();	 Catch:{ all -> 0x0121 }
    L_0x0121:
        throw r14;	 Catch:{ all -> 0x0122 }
    L_0x0122:
        r14 = move-exception;
        if (r0 == 0) goto L_0x0128;
    L_0x0125:
        r0.close();	 Catch:{ all -> 0x0128 }
    L_0x0128:
        throw r14;
    L_0x0129:
        r0 = "Location";
        r0 = r1.getHeaderField(r0);
        r1 = new c.e.a.a.e.e$b;
        r2 = new java.net.URL;
        r2.<init>(r0);
        r1.m1175init(r14, r2, r6);
        r0 = r1;
        goto L_0x0166;
    L_0x013b:
        r14 = move-exception;
        r10.close();	 Catch:{ all -> 0x013f }
    L_0x013f:
        throw r14;	 Catch:{ all -> 0x0140 }
    L_0x0140:
        r14 = move-exception;
        if (r9 == 0) goto L_0x0146;
    L_0x0143:
        r9.close();	 Catch:{ all -> 0x0146 }
    L_0x0146:
        throw r14;	 Catch:{ ConnectException -> 0x0159, ConnectException | UnknownHostException -> 0x0157, c -> 0x0149, c | IOException -> 0x0147 }
    L_0x0147:
        r14 = move-exception;
        goto L_0x014a;
    L_0x0149:
        r14 = move-exception;
    L_0x014a:
        r0 = "Couldn't encode request, returning with 400";
        b.i.b.f.p0(r2, r0, r14);
        r0 = new c.e.a.a.e.e$b;
        r14 = 400; // 0x190 float:5.6E-43 double:1.976E-321;
        r0.m1175init(r14, r8, r6);
        goto L_0x0166;
    L_0x0157:
        r14 = move-exception;
        goto L_0x015a;
    L_0x0159:
        r14 = move-exception;
    L_0x015a:
        r0 = "Couldn't open connection, returning with 500";
        b.i.b.f.p0(r2, r0, r14);
        r0 = new c.e.a.a.e.e$b;
        r14 = 500; // 0x1f4 float:7.0E-43 double:2.47E-321;
        r0.m1175init(r14, r8, r6);
    L_0x0166:
        return r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.a.e.c.a(java.lang.Object):java.lang.Object");
    }
}
